<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:p="http://primefaces.org/ui">

<h:head>
<title>Étel napló - Hozzáadás</title>
</h:head>

<h:body>
	<h:form>
		<p:messages id="messages" />
		<p:panelGrid columns="2">
			<p:outputLabel value="Étel" for="recipeInput" />
			<p:selectOneMenu id="recipeInput"
				value="#{addFoodEntryDialog.entry.recipe}" effect="fade">
				<f:converter binding="#{recipeConverter}" />
				<f:selectItems value="#{recipeService.findAll()}" var="type"
					itemLabel="#{type.name}" itemValue="#{type}" />
			</p:selectOneMenu>
			<p:outputLabel value="Mennyiség" for="quantity" />
			<pe:inputNumber id="quantity"
					value="#{addFoodEntryDialog.entry.quantity}" decimalPlaces="0" />
			<p:outputLabel value="Időpont" for="dateInput" />
			  <p:calendar id="dateInput" value="#{addFoodEntryDialog.entry.date}"  showButtonPanel="true" pattern="yyyy.MM.dd HH:mm" stepMinute="10" yearRange="c-1:c+1"/>  
		</p:panelGrid>

		<p:commandButton value="Mentés" update="@form" id="saveButton"
			action="#{addFoodEntryDialog.save()}"
			actionListener="#{addFoodEntryDialog.close()}" />
	</h:form>
</h:body>

</html>
